package com.it.zhangjun.effective;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO
 *
 * @author jun.zhang6
 * @date 2021/4/12
 */
public class ExtendsTest {
    public static void main(String[] args) {
        ExtendsTest extendsTest = new ExtendsTest();
        List<? extends Father> list = extendsTest.getFather();
        System.out.println(list);
    }

    public List<Father> getFather() {
        List<Father> list = new ArrayList<>();
        list.add(new Son());
        return list;
    }

    class Human {

    }

    class Father extends Human {

    }

    class Son extends Father {

    }

    class LeiFeng extends Father {

    }
}
